from flask import Flask
from config import Config

def create_app(config_class=Config):
    app = Flask(__name__,
                static_folder='../static',    # 指定静态文件夹位置
                template_folder='../templates' # 指定模板文件夹位置
    )
    app.config.from_object(config_class)

    # 注册路由
    from app.routes import main
    app.register_blueprint(main)

    return app